IntelliJ Platform/Theme.ipynb (84 lines of code) (raw):
{
"cells": [
{
"metadata": {},
"cell_type": "markdown",
"source": [
"# IntelliJ Platform Theme Implementation Notebook\n",
"\n",
"This notebook demonstrates how to create and register a custom UI theme for IntelliJ IDEA using the Kotlin Notebook integration with the IntelliJ Platform. The notebook shows:\n",
"\n",
"- **Theme Creation**: Implementation of a custom `UIThemeProvider` that defines a theme with ID \"My Theme\" and references a `Theme.json` configuration file\n",
"- **Extension Registration**: Registration of the custom theme with the IntelliJ Platform's extension point system\n",
"- **Platform Integration**: Uses the `intellij-platform` library to bridge Kotlin Notebook with the IntelliJ Platform SDK\n",
"\n",
"The notebook contains executable code that creates a theme provider instance and registers it as an extension, allowing the custom theme to be available within the IntelliJ IDEA environment. The theme configuration is expected to be defined in the accompanying `Theme.json` file.\n"
]
},
{
"cell_type": "code",
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2025-07-10T11:14:10.243684Z",
"start_time": "2025-07-10T11:14:09.974109Z"
}
},
"source": "%use intellij-platform",
"outputs": [
{
"data": {
"text/plain": [
"IntelliJ Platform integration is loaded"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"execution_count": 1
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-07-10T11:14:10.280634Z",
"start_time": "2025-07-10T11:14:10.253044Z"
}
},
"cell_type": "code",
"source": [
"import com.intellij.ide.ui.UIThemeProvider\n",
"\n",
"val myTheme = UIThemeProvider().apply {\n",
" id = \"My Theme\"\n",
" path = \"Theme.json\"\n",
"}\n",
"\n",
"registerExtension(UIThemeProvider.EP_NAME, myTheme)"
],
"outputs": [],
"execution_count": 2
}
],
"metadata": {
"kernelspec": {
"display_name": "Kotlin",
"language": "kotlin",
"name": "kotlin"
},
"language_info": {
"name": "kotlin",
"version": "2.2.20-dev-4982",
"mimetype": "text/x-kotlin",
"file_extension": ".kt",
"pygments_lexer": "kotlin",
"codemirror_mode": "text/x-kotlin",
"nbconvert_exporter": ""
},
"ktnbPluginMetadata": {
"sessionRunMode": "IDE_PROCESS"
}
},
"nbformat": 4,
"nbformat_minor": 0
}